package com.aikg.kgrag_java.service;

import cn.hutool.core.bean.BeanUtil;
import com.aikg.kgrag_java.common.Result;
import com.aikg.kgrag_java.pojo.entity.FileStorage;
import com.aikg.kgrag_java.pojo.vo.FileVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.multipart.MultipartFile;

import java.util.ArrayList;
import java.util.List;

/**
* @description 针对表【file_storage(文件存储表，用于存储文件的基本信息，如文件名、类型、URL和MD5哈希值，以及文件所属的知识库名称)】的数据库操作Service
* @createDate 2025-01-03 09:30:26
*/
public interface FileStorageService extends IService<FileStorage> {

    /**
     * 删除文件存储本地
     * @param uploadFile
     * @param projectId
     * @param knowledgeBase
     * @param request
     * @return
     */
    Result  uploadFile(MultipartFile uploadFile, Integer projectId, String knowledgeBase, HttpServletRequest request);


    Result deleteFile(String fileName, String domain, String knowledgeBase, HttpServletRequest request);

    Result getKnowledgeDBsFileNumber(Integer projectId);

    boolean deleteKnowledgeDBFile(int projectId, String knowledgeDB_name, String filename);

    public List<FileVo> getFileByProjectIdAndKnowledgeDB(int projectId, String knowledgeDB);
}
